package 多线程.复习.创建线程的方法;

import sun.awt.windows.ThemeReader;

public class ThreadBy {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            System.out.println("线程1");
        },"线程1");


        System.out.println("主线程");

        Thread thread1 = new Thread(){
            @Override
            public void run() {
                System.out.println("匿名内部类");
            }
        };

        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("Runnable与匿名内部类实现创建线程");
            }
        },"匿名，Runnbale");
        thread2.start();

        thread.start();
        thread1.start();

    }
}
